// 新增 Result 类
class Result {
  constructor(code, msg, data) {
    this.code = code;
    this.msg = msg;
    this.data = data;
  }

  static success(data = null) {
    return new Result(200, '成功', data);
  }

  static error(code = 101, msg = '失败') {
    return new Result(code, msg, null);
  }
}

// 导出 Result 类
module.exports = Result;